import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class IconDataWidget extends StatelessWidget{
  final Icon _icon;
  final String _mainText;
  final String _subText;
  final Color _iconColor;
  IconDataWidget(this._icon,this._mainText,this._subText,this._iconColor);
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Container(
            alignment: Alignment.center,
            decoration: BoxDecoration(
                color: _iconColor,
                borderRadius: BorderRadius.circular(1000)
            ),
            child: IconButton(icon: _icon, onPressed: (){}),
          ),
          Expanded(
            child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Container(
                margin: EdgeInsets.fromLTRB(16, 4, 0, 0),
                child: Text(
                  _mainText,
                  style: TextStyle(color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),
                  maxLines: 1,
                  overflow: TextOverflow.ellipsis,
                ),
              ),
              Container(
                margin: EdgeInsets.fromLTRB(16, 0, 0, 0),
                child: Text(
                  _subText,
                  maxLines: 1,
                  style: TextStyle(color: Colors.grey,fontSize: 16,fontWeight: FontWeight.bold),
                  overflow: TextOverflow.ellipsis,
                ),
              ),
            ],
          ),
          )

        ],
      ),
    );
  }

}

class CourseCard extends StatelessWidget{
  final String course;
  final String period;
  final String teacher;
  final String assetName;
  CourseCard(this.course,this.period,this.teacher,this.assetName);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: 203,
      child: Container(
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(10),
          image: DecorationImage(
              image: AssetImage(assetName),
              fit: BoxFit.fill
          ),
        ),
        padding: EdgeInsets.all(16),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Row(
              children: <Widget>[
                Text(
                  course,
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 22,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                Expanded(child: Container()),
                Icon(Icons.more_vert,color: Colors.white,size: 28,)
              ],
            ),
            Text(period,
              style: TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.bold,
              ),
              overflow: TextOverflow.ellipsis,
            ),
            Expanded(child: Container()),
            Text(teacher,
              style: TextStyle(
                  color: Colors.white
              ),
              overflow: TextOverflow.ellipsis,
            )
          ],
        ),
      ),
    );
  }

}